<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
	<title>Document</title>
	<css file="__PUBLIC__/Css/style.css"/>
	<js file="__PUBLIC__/Js/jquery-1.7.2.min.js"/>
</head>
<body>
	<section class="widget" style="min-height:300px">
		<header>
			<span class="icon"></span>
			<hgroup>
				<h1>{$name}管理</h1>
				<a href="">填写表单</a>
			</hgroup>
		</header>
	<form action="{:U(GROUP_NAME.'/Home/delimg',array('path'=>$path))}" method="post" class="home">
		<h2>
			删除{$name}
		</h2>
		<div class="bg"> 
			<foreach name="imgs" item="v">
				<input type="radio" name="img" value="{$v}"><img src="/Public/images/{$path}/{$v}.jpg" alt="" id="{$v}" />
			</foreach>
		</div>
		<div>
			<button type="submit" class="green">提交删除</button>
		</div>
	</form>
	<form action="{:U(GROUP_NAME.'/Home/upimg',array('path'=>$path,'name'=>$id))}" method="post" class="home" enctype="multipart/form-data">
		<h2>
			上传{$name}
		</h2>
		<div class="bg"> 
			<input type="file" name="img" />
		</div>
		<div>
			<button type="submit" class="green">提交图片</button>
		</div>
	</form>
<script>
	$(function(){
		imgclick(".bg");
		
	});
	function imgclick(elem){
		$(elem+' img').click(function(){
			$(elem+' input[type=radio]').attr('checked',false);
			$(elem+' img').css('border-color','#999');
			$(this).css('border-color','red');
			var i=$(this).attr('id');
			$(elem+' input[value='+i+']').attr('checked','checked');
		});
	}
</script>
	</section>
</body>
</html>